#ifndef __FILESTREAM_H__
#define __FILESTREAM_H__

#include "TypeDef.h"
#include "Stream.h"

namespace Woo {
namespace IO {

class FileStream :
	public Stream
{
public:
	FileStream(string path);
	FileStream(string path, int flags);
	FileStream(string path, int flags, mode_t mode);
	virtual ~FileStream();

	virtual UInt32 GetLength();
	virtual UInt32 GetPosition();
	virtual void SetPosition(UInt32 position);
	virtual UInt32 Write(const Byte* buffer, UInt32 bufferSize);
	virtual UInt32 Read(Byte* buffer, UInt32 bufferSize);
	virtual void Close();
	virtual bool IsClosed();
	virtual bool CanRead();
	virtual bool CanWrite();

private:
	int		m_fd;
	string	m_path;
	bool	m_hasClosed;
};

} // namespace IO
} // namespace Woo

#endif // define __FILESTREAM_H__
